<?php

class Dashboard extends CI_Controller
{
    public function __construct()
    {
        parent::__construct();
        $this->load->helper('url');
        $this->load->library('users');
    }

    public function index()
    {
        $session = $this->users->readUserSession();

        if (!$session)
            redirect('index');

        $this->load->view('dashboard/index', ['user' => $session->user]);
    }
}